//package com.qf.demo.test;
//
//import com.qf.demo.mapper.TbOrderUsersDao;
//import com.qf.demo.model.TbUsers;
//import org.apache.ibatis.io.Resources;
//import org.apache.ibatis.session.SqlSession;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.apache.ibatis.session.SqlSessionFactoryBuilder;
//import org.junit.After;
//import org.junit.Before;
//import org.junit.Test;
//
//import java.io.IOException;
//import java.io.InputStream;
//import java.util.List;
//
//public class TbOrderUsersDao_test {
//    private TbOrderUsersDao tbOrderUsersDao;
//    private SqlSession session;
//    private InputStream in;
//
//    @Before
//    public void init() throws IOException {
//        //1.读取配置文件
//        in = Resources.getResourceAsStream("springmvc.xml");
//        //2.创建SqlSessionFactory工厂
//        SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
//        SqlSessionFactory factory = builder.build(in);
//        //3.使用工厂生产SqlSession对象
//        session = factory.openSession();
//        //4.使用SqlSession创建Dao接口的代理对象
//        tbOrderUsersDao = session.getMapper(TbOrderUsersDao.class);
//    }
//
//    @After
//    public void end() throws IOException {
//        //如果不希望junit修改的数据回滚，则手动进行提交
//        session.commit();
//        //6.释放资源
//        session.close();
//        in.close();
//    }
//
//    @Test
//    public void insertTbUsers(){
//            int id=1;
//       List <TbUsers> tbUsers=tbOrderUsersDao.findAllList(id);
//        for (TbUsers tbUser : tbUsers) {
//            System.out.println(tbUser);
//
//        }
//    }
//
//
//}
